package com.byit.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.plugins.Page;
import com.byit.domain.AppAddress;
import com.baomidou.mybatisplus.service.IService;
import com.byit.domain.AppApplication;
import com.byit.exception.ServiceException;

import javax.validation.Valid;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 常用地址表 服务类
 * </p>
 *
 * @author puyunfeng
 * @since 2019-01-17
 */
public interface IAppAddressService extends IService<AppAddress> {

    List<JSONObject> selectByUserId(Long userId);

    void saveOrUpdate(AppAddress address) throws ServiceException;

    void deleteByIdAndUserId(Long addressId, Long userId);

    List<JSONObject> selectProvince();

    List<JSONObject> selectCity(Long provinceId);

    List<JSONObject> selectRegion(Long cityId);

    Page<JSONObject> selectAddressList(Page<AppApplication> pageInfo, Map<String, Object> keyword);
}
